import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        int n = in.nextInt();
        int k = in.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = in.nextInt();
        }
        PriorityQueue<Integer> queue = new PriorityQueue<>(k);
        int sum = 0;
        for (int num : nums) {
            if (num % 2 == 0) {
                if (queue.size() < k) {
                    queue.offer(num);
                } else {
                    if (num > queue.peek()) {
                        sum += queue.poll();
                        queue.offer(num);
                    } else {
                        sum += num;
                    }
                }
            } else {
                sum += num;
            }
        }
        PriorityQueue<Integer> queue2 = new PriorityQueue<>(k, Comparator.reverseOrder());
        while (queue.size() > 0) {
            queue2.offer(queue.poll());
        }
        while (k > 0) {
            int tmp = queue2.poll();
            if ((tmp / 2) % 2 == 0) {
                queue2.offer(tmp/2);
            } else {
                sum += tmp / 2;
            }
            k--;
        }
        while (queue2.size() > 0) {
            sum += queue2.poll();
        }
        System.out.println(sum);
    }
}
